package com.lai.gulimall.ware.dao;

import com.lai.gulimall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author laiciqi
 * @email 602469238@qq.com
 * @date 2021-11-07 12:16:23
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    void updateStock(WareSkuEntity wareSkuEntity);

    Long getSkusHasStock(@Param("skuId") Long skuId);

    List<Long> listWareIdHasSkuStock(@Param("skuId")Long skuId);

    Long lockSkuStock(@Param("skuId") Long skuId,@Param("wareId")Long wareId,@Param("num")Integer num);
}
